package concurrency.basicthreading.demo;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class Demo14ExceptionThread implements Runnable {

	@Override
	public void run() {
		//throw new RuntimeException();
		
		Thread t = Thread.currentThread();
		System.out.println("run() by " + t);
		System.out.println("eh = " + t.getUncaughtExceptionHandler());
		
		throw new RuntimeException();
	}
	
	//Run方法中的异常将传播到外部，main方法展示了运行时发生的事情。
	public static void main(String[] args) throws Exception {
		ExecutorService exec = Executors.newCachedThreadPool();
		exec.execute(new Demo14ExceptionThread());
		exec.shutdown();
	}
	
	//接下来我们尝试在Demo14NaiveExceptionHanding类的main方法中捕获这个异常，
}
